<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.5.8 is released, Support Pascal/Swig program and Lua53 runtime</title>
    <meta name="description" content="xmake is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the confi...">

    
    <meta name="keywords" content="xmake,lua,C/C++,pascal,swig,lua5.3,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/2021/10/08/xmake-update-v2.5.8/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/cn?lang=0">
                    
                        <i class="fa fa-home"></i>中文
                    </a>
                </li>

                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>Projects
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/archive/">
                            
                        
                            <i class="fa fa-archive"></i>Archives
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/category/">
                            
                        
                            <i class="fa fa-th-list"></i>Categories
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/tag/">
                            
                        
                            <i class="fa fa-tags"></i>Tags
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/docs/">
                            
                        
                            <i class="fa fa-book"></i>Documents
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="https://xmake.io/#/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>Community
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/donation/">
                            
                        
                            <i class="fa fa-heart"></i>Donate
                        </a>
                    </li>
                    
                    
                    
                
                    
                     
                    
                
                    
                     
                     
                    <li>

                        
                            
                            <a href="/about/">
                            
                        
                            <i class="fa fa-user"></i>About
                        </a>
                    </li>
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                     
                     
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.5.8 is released, Support Pascal/Swig program and Lua53 runtime</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2021-10-08
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#pascal" title="Tag: pascal" rel="tag">pascal</a-->
        <a href="/tag/#pascal" title="Tag: pascal" rel="tag">pascal</a>&nbsp;
    
        <!--a href="/tag/#swig" title="Tag: swig" rel="tag">swig</a-->
        <a href="/tag/#swig" title="Tag: swig" rel="tag">swig</a>&nbsp;
    
        <!--a href="/tag/#lua5.3" title="Tag: lua5.3" rel="tag">lua5.3</a-->
        <a href="/tag/#lua5.3" title="Tag: lua5.3" rel="tag">lua5.3</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p><a href="https://github.com/xmake-io/xmake">xmake</a> is a lightweight cross-platform build tool based on Lua. It uses xmake.lua to maintain project builds. Compared with makefile/CMakeLists.txt, the configuration syntax is more Concise and intuitive, it is very friendly to novices, and you can get started quickly in a short time, allowing users to focus more on actual project development.</p>

<p>In this version, we mainly added support for the construction of Pascal language projects and Swig modules, and for the Vala language support added in the previous version, we have also made further improvements, adding support for the construction of dynamic and static libraries.</p>

<p>In addition, xmake now also supports the optional Lua5.3 runtime, which provides better cross-platform support. At present, xmake has been able to run normally on the LoongArch architecture.</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">Github</a></li>
  <li><a href="https://xmake.io/">Document</a></li>
</ul>

<h2 id="new-feature-introduction">New feature introduction</h2>

<h3 id="pascal-language-support">Pascal language support</h3>

<p>Currently, we can use the cross-platform Free Pascal toolchain fpc to compile and build Pascal programs, for example:</p>

<h4 id="console-program">Console Program</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.debug"</span><span class="p">,</span> <span class="s2">"mode.release"</span><span class="p">)</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.pas"</span><span class="p">)</span>
</code></pre>
</div>

<h4 id="dynamic-library-program">Dynamic library program</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.debug"</span><span class="p">,</span> <span class="s2">"mode.release"</span><span class="p">)</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/foo.pas"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/main.pas"</span><span class="p">)</span>
</code></pre>
</div>

<p>We can also add compilation options related to Pascal code through the <code class="highlighter-rouge">add_fcflags()</code> interface.</p>

<p>For more examples, see: <a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/pascal">Pascal examples</a></p>

<h3 id="vala-library-compilation-support">Vala library compilation support</h3>

<p>In the last version, we added support for the Vala language, but before, we could only support the compilation of console programs, and could not generate library files. In this version, we have added additional compilation support for static libraries and dynamic libraries.</p>

<h4 id="static-library-program">Static library program</h4>

<p>We can set the exported interface header file name by <code class="highlighter-rouge">add_values("vala.header", "mymath.h")</code>, and set the exported vapi by <code class="highlighter-rouge">add_values("vala.vapi", "mymath-1.0.vapi")</code> file name.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.release"</span><span class="p">,</span> <span class="s2">"mode.debug"</span><span class="p">)</span>

<span class="n">add_requires</span><span class="p">(</span><span class="s2">"glib"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"mymath"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"static"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"vala"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/mymath.vala"</span><span class="p">)</span>
    <span class="n">add_values</span><span class="p">(</span><span class="s2">"vala.header"</span><span class="p">,</span> <span class="s2">"mymath.h"</span><span class="p">)</span>
    <span class="n">add_values</span><span class="p">(</span><span class="s2">"vala.vapi"</span><span class="p">,</span> <span class="s2">"mymath-1.0.vapi"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"glib"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"mymath"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"vala"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/main.vala"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"glib"</span><span class="p">)</span>
</code></pre>
</div>

<h4 id="dynamic-library-program-1">Dynamic library program</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.release"</span><span class="p">,</span> <span class="s2">"mode.debug"</span><span class="p">)</span>

<span class="n">add_requires</span><span class="p">(</span><span class="s2">"glib"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"mymath"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"vala"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/mymath.vala"</span><span class="p">)</span>
    <span class="n">add_values</span><span class="p">(</span><span class="s2">"vala.header"</span><span class="p">,</span> <span class="s2">"mymath.h"</span><span class="p">)</span>
    <span class="n">add_values</span><span class="p">(</span><span class="s2">"vala.vapi"</span><span class="p">,</span> <span class="s2">"mymath-1.0.vapi"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"glib"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"mymath"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"vala"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/main.vala"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"glib"</span><span class="p">)</span>
</code></pre>
</div>

<p>For more examples, see: <a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/vala">Vala examples</a></p>

<h3 id="swig-module-support">Swig module support</h3>

<p>We provide <code class="highlighter-rouge">swig.c</code> and <code class="highlighter-rouge">swig.cpp</code> rules, which can call the swig program to generate the c/c++ module interface code for the specified script language, and then cooperate with the xmake package management system to achieve fully automated module and dependency package integration .</p>

<p>Related issues: <a href="https://github.com/xmake-io/xmake/issues/1622">#1622</a></p>

<h4 id="luac-module">Lua/C Module</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.release"</span><span class="p">,</span> <span class="s2">"mode.debug"</span><span class="p">)</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"lua"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"example"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"swig.c"</span><span class="p">,</span> <span class="p">{</span><span class="n">moduletype</span> <span class="o">=</span> <span class="s2">"lua"</span><span class="p">})</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/example.i"</span><span class="p">,</span> <span class="p">{</span><span class="n">swigflags</span> <span class="o">=</span> <span class="s2">"-no-old-metatable-bindings"</span><span class="p">})</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/example.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"lua"</span><span class="p">)</span>
</code></pre>
</div>

<p>Among them, swigflags can be set to pass some swig-specific flags options.</p>

<h4 id="pythonc-module">Python/C module</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.release"</span><span class="p">,</span> <span class="s2">"mode.debug"</span><span class="p">)</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"python 3.x"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"example"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"swig.c"</span><span class="p">,</span> <span class="p">{</span><span class="n">moduletype</span> <span class="o">=</span> <span class="s2">"python"</span><span class="p">})</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/example.i"</span><span class="p">,</span> <span class="p">{</span><span class="n">scriptdir</span> <span class="o">=</span> <span class="s2">"share"</span><span class="p">})</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/example.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"python"</span><span class="p">)</span>
</code></pre>
</div>

<p>If scriptdir is set, then when we perform the installation, the python wrap script of the corresponding module will be installed to the specified directory.</p>

<h4 id="pythonc-module-1">Python/C++ Module</h4>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.release"</span><span class="p">,</span> <span class="s2">"mode.debug"</span><span class="p">)</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"python 3.x"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"example"</span><span class="p">)</span>
    <span class="n">add_rules</span><span class="p">(</span><span class="s2">"swig.cpp"</span><span class="p">,</span> <span class="p">{</span><span class="n">moduletype</span> <span class="o">=</span> <span class="s2">"python"</span><span class="p">})</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/example.i"</span><span class="p">,</span> <span class="p">{</span><span class="n">scriptdir</span> <span class="o">=</span> <span class="s2">"share"</span><span class="p">})</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/example.cpp"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"python"</span><span class="p">)</span>
</code></pre>
</div>

<h3 id="lua53-runtime-support">Lua5.3 runtime support</h3>

<p>Xmake has always used Luajit as the default runtime, because it was considered that Luajit is relatively faster, and the fixed Lua 5.1 syntax is more suitable for the needs of xmake’s internal implementation.</p>

<p>However, considering that Luajit’s update is not strong, the author’s maintenance is not very active, and its cross-platform performance is relatively poor. For some new architectures, such as Loongarch, riscv, etc., the support is not timely, which somewhat limits the platform support of xmake. .</p>

<p>For this reason, in the new version, we also built Lua5.3 as an optional runtime. We only need to compile and install xmake with the following command to switch from Luajit to Lua5.3 runtime:</p>

<h4 id="linuxmacos">Linux/macOS</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>make <span class="nv">RUNTIME</span><span class="o">=</span>lua
</code></pre>
</div>

<h4 id="windows">Windows</h4>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span><span class="nb">cd </span>core
<span class="gp">$ </span>xmake f --runtime<span class="o">=</span>lua
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>At present, the current version is still the default luajit runtime. Users can switch to Lua5.3 runtime according to their needs, but this has almost no compatibility impact on the user’s project xmake.lua configuration script.</p>

<p>Because the configuration interface of xmake has already done a layer of abstract encapsulation, some native interfaces with compatibility differences in Luajit/Lua5.3 will not be open to users, so it is completely unaware for project construction.</p>

<p>The only difference is that xmake with Lua5.3 supports more platforms and architectures.</p>

<h4 id="performance-comparison">Performance comparison</h4>

<p>I have done some basic build tests. Whether it is startup time, build performance or memory usage, Lua5.3 and Luajit’s xmake are almost the same. Because for the build system, the main performance bottleneck is the compiler, and the loss of its own scripts is very small.</p>

<p>Moreover, some low-level Lua modules inside xmake, such as io, character encoding, string manipulation, etc., have all been rewritten in c code by themselves, and do not rely on a specific Lua runtime engine at all.</p>

<h4 id="will-you-consider-switching-to-lua-by-default">Will you consider switching to Lua by default?</h4>

<p>Since we have just supported Lua5.3, although it is relatively stable after testing, in order to ensure that the user environment is not affected in any way, we still need to observe for a period of time. In the short term, we still use Luajit by default.</p>

<p>When the 2.6.1 version starts, we will start to switch to Lua5.3 as the default runtime environment. If you are interested, you can also help test it online. If you encounter any problems, please feel free to report on issues.</p>

<h4 id="loongarch-architecture-support">LoongArch architecture support</h4>

<p>Since we added Lua5.3 runtime support, we can now support running xmake on the LoongArch architecture, and all test examples have been tested.</p>

<h4 id="lua-54">Lua 5.4</h4>

<p>At present, we are still on the sidelines of Lua 5.4. If we wait for Lua 5.4 to become stable later, we will also try to consider continuing to upgrade to Lua 5.4.</p>

<h3 id="third-party-source-code-mixed-compilation-support">Third-party source code mixed compilation support</h3>

<h4 id="integrated-cmake-source-library">Integrated CMake source library</h4>

<p>In the new version, we have been able to directly integrate the source library with CMakeLists.txt in our project through the package mode of xmake, instead of downloading and installing it remotely.</p>

<p>Related issues: <a href="https://github.com/xmake-io/xmake/issues/1714">#1714</a></p>

<p>For example, we have the following project structure:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>├── foo
│ ├── CMakeLists.txt
│ └── src
│ ├── foo.c
│ └── foo.h
├── src
│ └── main.c
├── test.lua
└── xmake.lua
</code></pre>
</div>

<p>The foo directory is a static library maintained by cmake, and the root directory is maintained by xmake. We can define the <code class="highlighter-rouge">package("foo")</code> package in xmake.lua to describe how to build the foo code library.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.debug"</span><span class="p">,</span> <span class="s2">"mode.release"</span><span class="p">)</span>

<span class="n">package</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"cmake"</span><span class="p">)</span>
    <span class="n">set_sourcedir</span><span class="p">(</span><span class="n">path</span><span class="p">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">scriptdir</span><span class="p">(),</span> <span class="s2">"foo"</span><span class="p">))</span>
    <span class="n">on_install</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="kd">local</span> <span class="n">configs</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"-DCMAKE_BUILD_TYPE="</span> <span class="o">..</span> <span class="p">(</span><span class="n">package</span><span class="p">:</span><span class="n">debug</span><span class="p">()</span> <span class="ow">and</span> <span class="s2">"Debug"</span> <span class="ow">or</span> <span class="s2">"Release"</span><span class="p">))</span>
        <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"-DBUILD_SHARED_LIBS="</span> <span class="o">..</span> <span class="p">(</span><span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span> <span class="ow">and</span> <span class="s2">"ON"</span> <span class="ow">or</span> <span class="s2">"OFF"</span><span class="p">))</span>
        <span class="n">import</span><span class="p">(</span><span class="s2">"package.tools.cmake"</span><span class="p">).</span><span class="n">install</span><span class="p">(</span><span class="n">package</span><span class="p">,</span> <span class="n">configs</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>
    <span class="n">on_test</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="nb">assert</span><span class="p">(</span><span class="n">package</span><span class="p">:</span><span class="n">has_cfuncs</span><span class="p">(</span><span class="s2">"add"</span><span class="p">,</span> <span class="p">{</span><span class="n">includes</span> <span class="o">=</span> <span class="s2">"foo.h"</span><span class="p">}))</span>
    <span class="k">end</span><span class="p">)</span>
<span class="n">package_end</span><span class="p">()</span>

<span class="n">add_requires</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"demo"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/main.c"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
</code></pre>
</div>

<p>Among them, we set the code directory location of the foo package through <code class="highlighter-rouge">set_sourcedir()</code>, and then import the auxiliary module of <code class="highlighter-rouge">package.tools.cmake</code> through import to call cmake to build the code, xmake will automatically obtain the generated libfoo.a and the corresponding header document.</p>

<p>!&gt; If only the local source code is integrated, we don’t need to set additional <code class="highlighter-rouge">add_urls</code> and <code class="highlighter-rouge">add_versions</code>.</p>

<p>For the configuration description of the package, see: <a href="https://xmake.io/#/package/remote_package?id=package-description">Package description description</a>.</p>

<p>After defining the package, we can integrate it with <code class="highlighter-rouge">add_requires("foo")</code> and <code class="highlighter-rouge">add_packages("foo")</code>, just like integrating remote packages.</p>

<p>In addition, <code class="highlighter-rouge">on_test</code> is optional. If you want to strictly check whether the package is compiled and installed successfully, you can do some tests in it.</p>

<p>For a complete example, see: <a href="https://github.com/xmake-io/xmake/tree/master/tests/projects/c/library_with_cmakelists">Library with CMakeLists</a></p>

<h4 id="integrate-autoconf-source-library">Integrate autoconf source library</h4>

<p>We can also use <code class="highlighter-rouge">package.tools.autoconf</code> to locally integrate third-party code libraries maintained by autoconf.</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">package</span><span class="p">(</span><span class="s2">"pcre2"</span><span class="p">)</span>

    <span class="n">set_sourcedir</span><span class="p">(</span><span class="n">path</span><span class="p">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">scriptdir</span><span class="p">(),</span> <span class="s2">"3rd/pcre2"</span><span class="p">))</span>

    <span class="n">add_configs</span><span class="p">(</span><span class="s2">"jit"</span><span class="p">,</span> <span class="p">{</span><span class="n">description</span> <span class="o">=</span> <span class="s2">"Enable jit."</span><span class="p">,</span> <span class="n">default</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nb">type</span> <span class="o">=</span> <span class="s2">"boolean"</span><span class="p">})</span>
    <span class="n">add_configs</span><span class="p">(</span><span class="s2">"bitwidth"</span><span class="p">,</span> <span class="p">{</span><span class="n">description</span> <span class="o">=</span> <span class="s2">"Set the code unit width."</span><span class="p">,</span> <span class="n">default</span> <span class="o">=</span> <span class="s2">"8"</span><span class="p">,</span> <span class="n">values</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"8"</span><span class="p">,</span> <span class="s2">"16"</span><span class="p">,</span> <span class="s2">"32"</span><span class="p">}})</span>

    <span class="n">on_load</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="kd">local</span> <span class="n">bitwidth</span> <span class="o">=</span> <span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"bitwidth"</span><span class="p">)</span> <span class="ow">or</span> <span class="s2">"8"</span>
        <span class="n">package</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"links"</span><span class="p">,</span> <span class="s2">"pcre2-"</span> <span class="o">..</span> <span class="n">bitwidth</span><span class="p">)</span>
        <span class="n">package</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"defines"</span><span class="p">,</span> <span class="s2">"PCRE2_CODE_UNIT_WIDTH="</span> <span class="o">..</span> <span class="n">bitwidth</span><span class="p">)</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span> <span class="k">then</span>
            <span class="n">package</span><span class="p">:</span><span class="n">add</span><span class="p">(</span><span class="s2">"defines"</span><span class="p">,</span> <span class="s2">"PCRE2_STATIC"</span><span class="p">)</span>
        <span class="k">end</span>
    <span class="k">end</span><span class="p">)</span>

    <span class="n">on_install</span><span class="p">(</span><span class="s2">"macosx"</span><span class="p">,</span> <span class="s2">"linux"</span><span class="p">,</span> <span class="s2">"mingw"</span><span class="p">,</span> <span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="kd">local</span> <span class="n">configs</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--enable-shared="</span> <span class="o">..</span> <span class="p">(</span><span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span> <span class="ow">and</span> <span class="s2">"yes"</span> <span class="ow">or</span> <span class="s2">"no"</span><span class="p">))</span>
        <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--enable-static="</span> <span class="o">..</span> <span class="p">(</span><span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span> <span class="ow">and</span> <span class="s2">"no"</span> <span class="ow">or</span> <span class="s2">"yes"</span><span class="p">))</span>
        <span class="k">if</span> <span class="n">package</span><span class="p">:</span><span class="n">debug</span><span class="p">()</span> <span class="k">then</span>
            <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--enable-debug"</span><span class="p">)</span>
        <span class="k">end</span>
        <span class="k">if</span> <span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"pic"</span><span class="p">)</span> <span class="o">~=</span> <span class="kc">false</span> <span class="k">then</span>
            <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--with-pic"</span><span class="p">)</span>
        <span class="k">end</span>
        <span class="k">if</span> <span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"jit"</span><span class="p">)</span> <span class="k">then</span>
            <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--enable-jit"</span><span class="p">)</span>
        <span class="k">end</span>
        <span class="kd">local</span> <span class="n">bitwidth</span> <span class="o">=</span> <span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"bitwidth"</span><span class="p">)</span> <span class="ow">or</span> <span class="s2">"8"</span>
        <span class="k">if</span> <span class="n">bitwidth</span> <span class="o">~=</span> <span class="s2">"8"</span> <span class="k">then</span>
            <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--disable-pcre2-8"</span><span class="p">)</span>
            <span class="nb">table.insert</span><span class="p">(</span><span class="n">configs</span><span class="p">,</span> <span class="s2">"--enable-pcre2-"</span> <span class="o">..</span> <span class="n">bitwidth</span><span class="p">)</span>
        <span class="k">end</span>
        <span class="n">import</span><span class="p">(</span><span class="s2">"package.tools.autoconf"</span><span class="p">).</span><span class="n">install</span><span class="p">(</span><span class="n">package</span><span class="p">,</span> <span class="n">configs</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>

    <span class="n">on_test</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="nb">assert</span><span class="p">(</span><span class="n">package</span><span class="p">:</span><span class="n">has_cfuncs</span><span class="p">(</span><span class="s2">"pcre2_compile"</span><span class="p">,</span> <span class="p">{</span><span class="n">includes</span> <span class="o">=</span> <span class="s2">"pcre2.h"</span><span class="p">}))</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>Both <code class="highlighter-rouge">package.tools.autoconf</code> and <code class="highlighter-rouge">package.tools.cmake</code> modules can support cross-compilation platforms and toolchains such as mingw/cross/iphoneos/android, xmake will automatically pass the corresponding toolchain into it, and the user does not need to do Anything else.</p>

<h4 id="integrate-with-other-build-systems">Integrate with other build systems</h4>

<p>We also support the integration of code libraries maintained by other build systems such as Meson/Scons/Make. You only need to import the corresponding build auxiliary modules. I won’t go into details here. We can further check the documentation: <a href="https://xmake.io/#/zh-cn/package/local_3rd_source_library">Integrate local third-party source code libraries </a></p>

<h3 id="improve-compiler-feature-detection">Improve compiler feature detection</h3>

<p>In the previous version, we can use the <code class="highlighter-rouge">check_features</code> auxiliary interface to detect specific compiler features, such as:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">includes</span><span class="p">(</span><span class="s2">"check_features.lua"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"*.c"</span><span class="p">)</span>
    <span class="n">add_configfiles</span><span class="p">(</span><span class="s2">"config.h.in"</span><span class="p">)</span>
    <span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CONSTEXPR"</span><span class="p">,</span> <span class="s2">"cxx_constexpr"</span><span class="p">)</span>
    <span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CONSEXPR_AND_STATIC_ASSERT"</span><span class="p">,</span> <span class="p">{</span><span class="s2">"cxx_constexpr"</span><span class="p">,</span> <span class="s2">"c_static_assert"</span><span class="p">},</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c++11"</span><span class="p">})</span>
</code></pre>
</div>

<p>config.h.in</p>

<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="err">$</span><span class="p">{</span><span class="n">define</span> <span class="n">HAS_CONSTEXPR</span><span class="p">}</span>
<span class="err">$</span><span class="p">{</span><span class="n">define</span> <span class="n">HAS_CONSEXPR_AND_STATIC_ASSERT</span><span class="p">}</span>
</code></pre>
</div>

<p>config.h</p>

<div class="language-c highlighter-rouge"><pre class="highlight"><code><span class="cm">/* #undef HAS_CONSTEXPR */</span>
<span class="cp">#define HAS_CONSEXPR_AND_STATIC_ASSERT 1
</span></code></pre>
</div>

<p>If the current cxx_constexpr feature supports it, the HAS_CONSTEXPR macro will be enabled in config.h.</p>

<h4 id="added-cc-standard-support-detection">Added C/C++ standard support detection</h4>

<p>After 2.5.8, we continue to add support for cstd and c++ std version detection, related issues: <a href="https://github.com/xmake-io/xmake/issues/1715">#1715</a></p>

<p>E.g:</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CXX_STD_98"</span><span class="p">,</span> <span class="s2">"cxx_std_98"</span><span class="p">)</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CXX_STD_11"</span><span class="p">,</span> <span class="s2">"cxx_std_11"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c++11"</span><span class="p">})</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CXX_STD_14"</span><span class="p">,</span> <span class="s2">"cxx_std_14"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c++14"</span><span class="p">})</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CXX_STD_17"</span><span class="p">,</span> <span class="s2">"cxx_std_17"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c++17"</span><span class="p">})</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_CXX_STD_20"</span><span class="p">,</span> <span class="s2">"cxx_std_20"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c++20"</span><span class="p">})</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_C_STD_89"</span><span class="p">,</span> <span class="s2">"c_std_89"</span><span class="p">)</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_C_STD_99"</span><span class="p">,</span> <span class="s2">"c_std_99"</span><span class="p">)</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_C_STD_11"</span><span class="p">,</span> <span class="s2">"c_std_11"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c11"</span><span class="p">})</span>
<span class="n">configvar_check_features</span><span class="p">(</span><span class="s2">"HAS_C_STD_17"</span><span class="p">,</span> <span class="s2">"c_std_17"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c17"</span><span class="p">})</span>
</code></pre>
</div>

<h4 id="new-compiler-built-in-macro-detection">New compiler built-in macro detection</h4>

<p>We can also detect the existence of some built-in macro definitions in the compiler, such as <code class="highlighter-rouge">__GNUC__</code>, etc. We can use the <code class="highlighter-rouge">check_macros</code> and <code class="highlighter-rouge">configvar_check_macros</code> auxiliary scripts to detect their existence.</p>

<p>Related issues: <a href="https://github.com/xmake-io/xmake/issues/1715">#1715</a></p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="o">-</span> <span class="n">Check</span> <span class="n">whether</span> <span class="n">the</span> <span class="n">macro</span> <span class="n">is</span> <span class="n">defined</span>
<span class="n">configvar_check_macros</span><span class="p">(</span><span class="s2">"HAS_GCC"</span><span class="p">,</span> <span class="s2">"__GNUC__"</span><span class="p">)</span>
<span class="o">-</span> <span class="n">The</span> <span class="n">detection</span> <span class="n">macro</span> <span class="n">is</span> <span class="ow">not</span> <span class="n">defined</span>
<span class="n">configvar_check_macros</span><span class="p">(</span><span class="s2">"NO_GCC"</span><span class="p">,</span> <span class="s2">"__GNUC__"</span><span class="p">,</span> <span class="p">{</span><span class="n">defined</span> <span class="o">=</span> <span class="kc">false</span><span class="p">})</span>
<span class="o">-</span> <span class="n">Detect</span> <span class="n">macro</span> <span class="n">conditions</span>
<span class="n">configvar_check_macros</span><span class="p">(</span><span class="s2">"HAS_CXX20"</span><span class="p">,</span> <span class="s2">"__cplusplus &gt;= 202002L"</span><span class="p">,</span> <span class="p">{</span><span class="n">languages</span> <span class="o">=</span> <span class="s2">"c++20"</span><span class="p">})</span>
</code></pre>
</div>

<h3 id="added-support-for-qt-4x">Added support for Qt 4.x</h3>

<p>In addition to Qt 5.x and 6.x, we have also added support for some old projects based on Qt 4.x.</p>

<h3 id="added-support-for-android-ndk-r23">Added support for Android NDK r23</h3>

<p>Due to some structural changes made by google to the Android NDK, r23 has affected the support of xmake for some compilation features of the android project. In this version, we have also made a repair.</p>

<h3 id="fix-the-unicode-encoding-problem-of-the-vsxmake-plugin">Fix the Unicode encoding problem of the vsxmake plugin</h3>

<p>In addition, if Unicode is used as the project directory, the generated vsxmake project will be affected, causing many problems in the compilation and access of the vs project. We have also fixed it in the new version.</p>

<h2 id="changelog">Changelog</h2>

<h3 id="new-features">New features</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/388">#388</a>: Pascal Language Support</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1682">#1682</a>: Add optional lua5.3 backend instead of luajit to provide better compatibility</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1622">#1622</a>: Support Swig</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1714">#1714</a>: Support build local embed cmake projects</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1715">#1715</a>: Support to detect compiler language standards as features and add <code class="highlighter-rouge">check_macros</code></li>
  <li>Support Loongarch</li>
</ul>

<h3 id="change">Change</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1618">#1618</a>: Improve vala to support to generate libraries and bindings</li>
  <li>Improve Qt rules to support Qt 4.x</li>
  <li>Improve <code class="highlighter-rouge">set_symbols("debug")</code> to generate pdb file for clang on windows</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1638">#1638</a>: Improve to merge static library</li>
  <li>Improve on_load/after_load to support to add target deps dynamically</li>
  <li><a href="https://github.com/xmake-io/xmake/pull/1675">#1675</a>: Rename dynamic and import library suffix for mingw</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1694">#1694</a>: Support to define a variable without quotes for configuration files</li>
  <li>Support Android NDK r23</li>
  <li>Add <code class="highlighter-rouge">c++latest</code> and <code class="highlighter-rouge">clatest</code> for <code class="highlighter-rouge">set_languages</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1720">#1720</a>: Add <code class="highlighter-rouge">save_scope</code> and <code class="highlighter-rouge">restore_scope</code> to fix <code class="highlighter-rouge">check_xxx</code> apis</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1726">#1726</a>: Improve compile_commands generator to support nvcc</li>
</ul>

<h3 id="bugs-fixed">Bugs fixed</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1671">#1671</a>: Fix incorrect absolute path after installing precompiled packages</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1689">#1689</a>: Fix unicode chars bug for vsxmake</li>
</ul>


        </article>
        <hr>

        <!-- baidu ads -->
        

        
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="chinese">中文</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
        
            </ul>
        

        
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">Similar Posts</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/2021/12/17/xmake-update-v2.6.2/">Xmake v2.6.2 released, Support building Linux kernel driver module
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 released, Switch to Lua5.4 runtime, Support Rust and C++ mixed compilation
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 released, Improve C++20 Modules and support Nim, Keil MDK and Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 released, Use lockfile to freeze package dependencies and Vala/Metal language support
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/2021/07/26/xmake-update-v2.5.6/">xmake v2.5.6 released, Improve compatibility of pre-compiled binary package
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>Prev Post</strong> <a href="/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 released, Use lockfile to freeze package dependencies and Vala/Metal language support</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>Next Post</strong> <a href="/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 released, Improve C++20 Modules and support Nim, Keil MDK and Unity Build</a></p>
        
    </div>
</div>


        <h2 id="comments">Comments</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,      
  language: 'en',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">


            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    Content
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#chinese">中文</a></li>
                    <li><a href="#similar_posts">Similar Posts</a></li>
                    <li><a href="#comments">Comments</a></li>
                </ul>
            </div>

            <!-- baidu ads -->
            

            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    Links
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

            <!-- chitika ads -->
            
        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
